﻿#region Copyright (C) Sector7 Software Studio. All rights reserved
/*******************************************************************************************
 * Creation
 *      Author:         Wolf Lai
 *      Date:           2013/8/7 星期三 20:08:21
 *      Version:        
 * Modification 
 *      Author: 
 *      Date: 
 *      Description: 
 *      Version:
 *******************************************************************************************/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sector7.Medical.EntityType;
using Sector7.Medical.Utility;
using Sector7.Medical.Enums;

namespace Sector7.Medical.Biz
{
    /// <summary>
    /// <!-- The description about this class. -->
    /// </summary>
    public class Agent_BIZS
    {
        #region Public functions

        #region /// ChargeRecord
        /// <summary>
        /// 添加费用信息
        /// </summary>
        /// <param name="chargeRecord">费用信息</param>
        /// <returns></returns>
        public static int AddChargeRecord(M7_ChargeRecord chargeRecord)
        {
            return WcfClient.BIZS.Invoke<int>(
                service => service.AddChargeRecord(chargeRecord));
        }
        #endregion

        #region ///Registry Record
        /// <summary>
        /// 获取一天的挂号记录
        /// </summary>
        /// <param name="date"></param>
        /// <returns></returns>
        public static List<M7_RegistryRecord> GetRegistryRecoredListInOneDay(DateTime date)
        {
            return WcfClient.BIZS.Invoke<List<M7_RegistryRecord>>(
                service => service.GetRegistryRecoredListInOneDay(date));
        }

        /// <summary>
        /// 添加挂号信息
        /// </summary>
        /// <param name="registryRecord">挂号信息</param>
        /// <returns></returns>
        public static int AddRegistryRecord(M7_RegistryRecord registryRecord)
        {
            return WcfClient.BIZS.Invoke<int>(
                service => service.AddRegistryRecord(registryRecord));
        }
        #endregion

        #region /// Patient
        /// <summary>
        /// 添加病人
        /// </summary>
        /// <param name="patient">病人信息</param>
        /// <returns></returns>
        public static int AddPatient(M7_Patient patient)
        {
            return WcfClient.BIZS.Invoke<int>(
                service => service.AddPatient(patient));
        }

        /// <summary>
        /// 根据病人编码获取病人信息
        /// </summary>
        /// <param name="patientId"></param>
        /// <returns></returns>
        public static M7_Patient GetPatientByRegistryNo(RegistryNoType registryNoType, object registryNo)
        {
            return WcfClient.BIZS.Invoke<M7_Patient>(
                service => service.GetPatientByRegistryNo(registryNoType, registryNo));
        }
        #endregion

        #region ///MedicalRecord
        /// <summary>
        /// 添加电子病历信息
        /// </summary>
        /// <param name="medicalRecord"></param>
        /// <returns></returns>
        public static int AddMedicalRecord(M7_MedicalRecord medicalRecord)
        {
            return WcfClient.BIZS.Invoke<int>(
                service => service.AddMedicalRecord(medicalRecord));
        }

        /// <summary>
        /// 根据人员信息编码和状态获取电子病历信息
        /// </summary>
        /// <param name="citizen"></param>
        /// <param name="status"></param>
        /// <returns></returns>
        public static List<M7_MedicalRecord> GetMedicalRecordByCitizenAndStatus(string citizen, int status)
        {
            return WcfClient.BIZS.Invoke<List<M7_MedicalRecord>>(
                service => service.GetMedicalRecordByCitizenAndStatus(citizen, status));
        }

        public static List<M7_MedicalRecord> GetRecentTenMedicalRecordList(string citizenId)
        {
            return WcfClient.BIZS.Invoke<List<M7_MedicalRecord>>(
                service => service.GetRecentTenMedicalRecordList(citizenId));
        }
        #endregion

        #region ///Recipe
        /// <summary>
        /// 添加处方信息
        /// </summary>
        /// <param name="recipe"></param>
        /// <returns></returns>
        public static int AddRecipe(M7_Recipe recipe)
        {
            return WcfClient.BIZS.Invoke<int>(
                service => service.AddRecipe(recipe));
        }

        /// <summary>
        /// 根据电子病历编号和单据状态获取所有处方单信息
        /// </summary>
        /// <returns></returns>
        public static List<M7_Recipe> GetPatientRecipeListByEmrIdAndStatus(long emrId, int status)
        {
            return WcfClient.BIZS.Invoke<List<M7_Recipe>>(
            service => service.GetPatientRecipeListByEmrIdAndStatus(emrId, status));
        }

        #endregion

        #endregion

        #region Private functions
        #endregion
    }
}